package com.example.controllers;

import com.example.common.JsonResult;
import com.example.domain.Admin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by jianweilin on 16/9/8.
 */
@RestController
@RequestMapping(value = "/admin")
public class AdminController {

    @RequestMapping(value = "/get",method = RequestMethod.GET)
    public JsonResult<Admin> get(@RequestParam String name, @RequestParam String password){
        return JsonResult.ok(new Admin(name,password));
    }

    @RequestMapping(value = "/post",method = RequestMethod.POST)
    public String post(@RequestParam String name,@RequestParam String password){
        return String.valueOf("POST : " + name);
    }
}
